<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<form:form method="post" action="/mvc/form.do" commandName="command" cssClass="cleanform">
    <div class="header">
        <h2>Form</h2>
        <c:if test="${not empty message}">
            <div id="message" class="success">${message}</div>
        </c:if>
    </div>
    <fieldset>
        <legend>Personal Info</legend>
        <form:label path="name">
            Name <form:errors path="name" cssClass="error"/>
        </form:label>
        <form:input path="name"/>

        <form:label path="age">
            Age <form:errors path="age" cssClass="error"/>
        </form:label>
        <form:input path="age"/>

        <form:label path="birthDate">
            Birth Date (in form yyyy-mm-dd) <form:errors path="birthDate" cssClass="error"/>
        </form:label>
        <form:input path="birthDate"/>

        <form:label path="phone">
            Phone (in form (###) ###-####) <form:errors path="phone" cssClass="error"/>
        </form:label>
        <form:input path="phone"/>

        <form:label path="currency">
            Currency (in form $#.##) <form:errors path="currency" cssClass="error"/>
        </form:label>
        <form:input path="currency"/>

        <form:label path="percent">
            Percentage (in form ##%) <form:errors path="percent" cssClass="error"/>
        </form:label>
        <form:input path="percent"/>

    </fieldset>

    <fieldset>
        <legend>Inquiry</legend>
        <form:label path="inquiry">
            Type (select one)
        </form:label>
        <form:select path="inquiry">
            <form:option value="comment">Comment</form:option>
            <form:option value="feedback">Feedback</form:option>
            <form:option value="suggestion">Suggestion</form:option>
        </form:select>

        <form:label path="inquiryDetails">
            Details
        </form:label>
        <form:textarea path="inquiryDetails"/>
    </fieldset>

    <%-- <fieldset class="checkbox">
         <legend>Request Additional Info</legend>
         <label><form:checkbox path="additionalInfo[mvc]" value="true"/>on Spring MVC</label>
         <label><form:checkbox path="additionalInfo[java]" value="true"/>on Java (4-ever)</label>
     </fieldset>--%>

    <fieldset class="radio">
        <legend>Subscribe to Newsletter?</legend>
        <label><form:radiobutton path="subscribeNewsletter" value="true"/>Yes</label>
        <label><form:radiobutton path="subscribeNewsletter" value="false"/> No</label>
    </fieldset>

    <p>
        <button type="submit">Submit</button>
    </p>
</form:form>